
let form = layui.form
function git() {
    $.ajax({
        url: "/my/userinfo",
        success: function (res) {
            console.log(res);
            if (res.status == 0) {
                form.val("user", res.data);
            }

        }
    })
}
git()
$(".layui-form").on("submit", function (e) {
    e.preventDefault();
    let data = form.val("user")
    $.ajax({
        url: "/my/userinfo",
        type: "POST",
        data: data,
        success: function (res) {
            layer.msg(res.message);
            if (res.status == 0) {
                window.parent.genInfo();
            }
        }
    })
})

$(".layui-form").on("reset", function (e) {
    e.preventDefault()
    git()
})